<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title>修改用户</title>
    <th:block th:replace="/backstage/common_resources::common_css"></th:block>
    <th:block th:replace="/backstage/common_resources::common_js"></th:block>
</head>

<body class="hold-transition skin-purple sidebar-mini">

<header th:replace="~{/backstage/common_header::header}"></header>
<aside th:replace="~{/backstage/common_aside::aside}"></aside>

    <div class="wrapper">
        <div class="content-wrapper">

            <!-- 内容头部 -->
            <section class="content-header">
                <h1>
                    员工管理
                    <small>修改员工</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a th:href="@{/backstage/index}"><i class="fa fa-dashboard"></i> 首页</a></li>
                    <li><a th:href="@{/backstage/users/all}">员工管理</a></li>
                    <li class="active">修改员工</li>
                </ol>
            </section>
            <!-- 内容头部 /-->

            <!-- 正文区域 -->
            <section class="content">
                <form th:action="@{/backstage/users/update}" method="post">
                    <input type="hidden" th:value="${user.uid}" name="uid">
<!--                    <div class="tab-pane" id="tab-common">-->
                        <div class="row data-type">

                            <div class="col-md-2 title">工号</div>
                            <div class="col-md-4 data">
                                <input type="text" class="form-control" placeholder="工号" name="username" th:value="${user.username}" readonly="readonly">
                            </div>

                            <div class="col-md-2 title">姓名</div>
                            <div class="col-md-4 data">
                                <input type="text" class="form-control" placeholder="姓名" name="name" th:value="${user.name}" readonly="readonly">
                            </div>


                            <div class="col-md-2 title">工龄</div>
                            <div class="col-md-4 data">
                                <input type="number" class="form-control" placeholder="工龄" name="workAge" th:value="${user.workAge}">
                            </div>

                            <div class="col-md-2 title">部门</div>
                            <div class="col-md-4 data">
                                <select class="form-control" name="department" th:value="${user.department}">
                                    <option value="" id="o1">--请选择--</option>
                                    <option value="销售部" id="o2">销售部</option>
                                    <option value="开发部" id="o3">开发部</option>
                                    <option value="测试部" id="o4">测试部</option>
                                    <option value="运维部" id="o5">运维部</option>
                                </select>
                                <script>
                                    $(function () {
                                        var department=[[${user.department}]];
                                        if ($('#o2').val()==department){
                                            $('#o2').attr(selected,true);
                                        }
                                        if ($('#o3').val()==department){
                                            $('#o3').attr(selected,true);
                                        }
                                        if ($('#o4').val()==department){
                                            $('#o4').attr(selected,true);
                                        }
                                        if ($('#o5').val()==department){
                                            $('#o5').attr(selected,true);
                                        }
                                    })

                                </script>
                            </div>

                            <div class="col-md-2 title"></div>
                            <div class="col-md-10 data text-center">
                                <button type="submit" class="btn bg-maroon">保存</button>
                                <button type="button" class="btn bg-default" onclick="history.back(-1);">返回</button>
                            </div>

                        </div>
<!--                    </div>-->
                </form>
                
            </section>
            <!-- 正文区域 /-->
        </div>
    </div>

<footer th:replace="~{/backstage/common_footer::footer}"></footer>

</body>

</html>